package ${implPackageName};

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import ${entityPackageName}.${className?cap_first};
import ${mapperPackageName}.${className?cap_first}Mapper;
import ${servicePackageName}.${className?cap_first}Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
* @description   ${description}
* @author        ${author}
* @date          ${createTime}
* @version       ${version}
**/
@Transactional
@Slf4j
@Service
public class ${className?cap_first}ServiceImpl extends ServiceImpl<${className?cap_first}Mapper, ${className?cap_first}> implements ${className?cap_first}Service{

    @Override
    public IPage<${className?cap_first}> findPage(Page initMpPage, ${className?cap_first} ${className}) {
        QueryWrapper<${className?cap_first}> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("is_delete","0");
        return this.page(initMpPage,queryWrapper);
    }

    @Override
    public List<${className?cap_first}> findList(${className?cap_first} ${className}) {
        QueryWrapper<${className?cap_first}> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("is_delete","0");
        List<${className?cap_first}> list = this.list(queryWrapper);
        return list;
    }

    @Override
    public ${className?cap_first} findById(String id) {
        return this.getById(id);
    }

    @Override
    public boolean add(${className?cap_first} ${className}) {
        return this.save(${className});
    }

    @Override
    public boolean update(${className?cap_first} ${className}) {
        return this.updateById(${className});
    }

    @Override
    public boolean delete(String id) {
        ${className?cap_first} ${className} = new ${className?cap_first}();
        ${className}.setId(id);
        ${className}.setIs_delete("1");
        return this.updateById(${className});
    }
}
